package com.nali.spreader.dao.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.ibatis.SqlMapClientTemplate;
import org.springframework.stereotype.Repository;

import com.nali.spreader.dao.ICrudActionStepDao;
import com.nali.spreader.model.ActionStep;
import com.nali.spreader.model.ActionStepExample;

@Repository
public class CrudActionStepDao implements ICrudActionStepDao {

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_action_step
     *
     * @ibatorgenerated Wed Jul 20 16:30:56 CST 2011
     */
    public CrudActionStepDao() {
        super();
    }

    /**
     * This field was generated by Apache iBATIS ibator.
     * This field corresponds to the database table spreader.tb_action_step
     *
     * @ibatorgenerated Thu Aug 04 16:40:11 CST 2011
     */
    @Autowired
    private SqlMapClientTemplate sqlMap;

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_action_step
     *
     * @ibatorgenerated Thu Aug 04 16:40:11 CST 2011
     */
    public int countByExample(ActionStepExample example) {
        Integer count = (Integer) getSqlMapClientTemplate().queryForObject("spreader_tb_action_step.ibatorgenerated_countByExample", example);
        return count;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_action_step
     *
     * @ibatorgenerated Thu Aug 04 16:40:11 CST 2011
     */
    public int deleteByExample(ActionStepExample example) {
        int rows = getSqlMapClientTemplate().delete("spreader_tb_action_step.ibatorgenerated_deleteByExample", example);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_action_step
     *
     * @ibatorgenerated Thu Aug 04 16:40:11 CST 2011
     */
    public int deleteByPrimaryKey(Long id) {
        ActionStep key = new ActionStep();
        key.setId(id);
        int rows = getSqlMapClientTemplate().delete("spreader_tb_action_step.ibatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_action_step
     *
     * @ibatorgenerated Thu Aug 04 16:40:11 CST 2011
     */
    public void insert(ActionStep record) {
        getSqlMapClientTemplate().insert("spreader_tb_action_step.ibatorgenerated_insert", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_action_step
     *
     * @ibatorgenerated Thu Aug 04 16:40:11 CST 2011
     */
    public void insertSelective(ActionStep record) {
        getSqlMapClientTemplate().insert("spreader_tb_action_step.ibatorgenerated_insertSelective", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_action_step
     *
     * @ibatorgenerated Thu Aug 04 16:40:11 CST 2011
     */
    @SuppressWarnings("unchecked")
    public List<ActionStep> selectByExampleWithBLOBs(ActionStepExample example) {
        List<ActionStep> list = getSqlMapClientTemplate().queryForList("spreader_tb_action_step.ibatorgenerated_selectByExampleWithBLOBs", example);
        return list;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_action_step
     *
     * @ibatorgenerated Thu Aug 04 16:40:11 CST 2011
     */
    @SuppressWarnings("unchecked")
    public List<ActionStep> selectByExampleWithoutBLOBs(ActionStepExample example) {
        List<ActionStep> list = getSqlMapClientTemplate().queryForList("spreader_tb_action_step.ibatorgenerated_selectByExample", example);
        return list;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_action_step
     *
     * @ibatorgenerated Thu Aug 04 16:40:11 CST 2011
     */
    public ActionStep selectByPrimaryKey(Long id) {
        ActionStep key = new ActionStep();
        key.setId(id);
        ActionStep record = (ActionStep) getSqlMapClientTemplate().queryForObject("spreader_tb_action_step.ibatorgenerated_selectByPrimaryKey", key);
        return record;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_action_step
     *
     * @ibatorgenerated Thu Aug 04 16:40:11 CST 2011
     */
    public int updateByExampleSelective(ActionStep record, ActionStepExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("spreader_tb_action_step.ibatorgenerated_updateByExampleSelective", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_action_step
     *
     * @ibatorgenerated Thu Aug 04 16:40:11 CST 2011
     */
    public int updateByExampleWithBLOBs(ActionStep record, ActionStepExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("spreader_tb_action_step.ibatorgenerated_updateByExampleWithBLOBs", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_action_step
     *
     * @ibatorgenerated Thu Aug 04 16:40:11 CST 2011
     */
    public int updateByExampleWithoutBLOBs(ActionStep record, ActionStepExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("spreader_tb_action_step.ibatorgenerated_updateByExample", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_action_step
     *
     * @ibatorgenerated Thu Aug 04 16:40:11 CST 2011
     */
    public int updateByPrimaryKeySelective(ActionStep record) {
        int rows = getSqlMapClientTemplate().update("spreader_tb_action_step.ibatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_action_step
     *
     * @ibatorgenerated Thu Aug 04 16:40:11 CST 2011
     */
    public int updateByPrimaryKeyWithBLOBs(ActionStep record) {
        int rows = getSqlMapClientTemplate().update("spreader_tb_action_step.ibatorgenerated_updateByPrimaryKeyWithBLOBs", record);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_action_step
     *
     * @ibatorgenerated Thu Aug 04 16:40:11 CST 2011
     */
    public int updateByPrimaryKeyWithoutBLOBs(ActionStep record) {
        int rows = getSqlMapClientTemplate().update("spreader_tb_action_step.ibatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_action_step
     *
     * @ibatorgenerated Thu Aug 04 16:40:11 CST 2011
     */
    public SqlMapClientTemplate getSqlMapClientTemplate() {
        return sqlMap;
    }

    /**
     * This class was generated by Apache iBATIS ibator.
     * This class corresponds to the database table spreader.tb_action_step
     *
     * @ibatorgenerated Thu Aug 04 16:40:11 CST 2011
     */
    private static class UpdateByExampleParms extends ActionStepExample {

        private Object record;

        public UpdateByExampleParms(Object record, ActionStepExample example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
}
